﻿<%@ page isELIgnored="false" language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>持名法州主页</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/themes/IconExtension.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/errchars/echarts.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/errchars/echarts.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/errchars/china.js"></script>

<script type="text/javascript">
	<!--菜单处理-->
    $(function(){
        $.ajax({
            url:"${pageContext.request.contextPath}/Menu/showAllMenu.do",
            dataType:"JSON",
            success:function (data) {
                console.log(data);
                var jihe1=data.menus;
                $.each(jihe1,function (index,one) {
//                    one 就是一级类别对象
                    var c = "";
//                    从一级对象中获取二级类别对象 one.child
                    $.each(one.children,function (index2,two) {
                        c += "<div style='text-align: center'><a href='#' class='easyui-linkbutton' data-options=\"iconCls:'icon-search',plain:true\" onclick=\"addTabs('" + two.menuName + "','" + two.menuUrl + "')\">" + two.menuName + "</a></div>";
                    })
//                    生成面板
                    $('#aa').accordion('add', {
                        title: one.menuName,
                        content: c,
                        selected: false
                    });
                })
            }

        })
    });



    // 通过方法打开一个新选项卡  通过选项卡 打开的是一个jsp页面
    function addTabs(menuName,menuUrl) {
        console.log(menuName)
        console.log(menuUrl);
        var flag = $("#tt").tabs("exists", menuName);
        if(flag){
            $("#tt").tabs("select", menuName);
        }else {
            $('#tt').tabs('add',{
                title:menuName,
                href:"${pageContext.request.contextPath}"+menuUrl,
                closable:true,
                tools:[{
                    iconCls:'icon-mini-refresh',
                    handler:function(){
                        alert('refresh');
                    }
                }]
            });
        }
    };


</script>


</head>
<body class="easyui-layout">   
    <div data-options="region:'north',split:true" style="height:60px;background-color:  #5C160C">
    	<div style="font-size: 24px;color: #FAF7F7;font-family: 楷体;font-weight: 900;width: 500px;float:left;padding-left: 20px;padding-top: 10px" >持名法州后台管理系统</div>
    	<div style="font-size: 16px;color: #FAF7F7;font-family: 楷体;width: 300px;float:right;padding-top:15px">欢迎您:${pageContext.session.getAttribute("admin").adminUsername} &nbsp;<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">修改密码</a>&nbsp;&nbsp;<a href="${pageContext.request.contextPath}/Admin/adminLogout.do" class="easyui-linkbutton" data-options="iconCls:'icon-01'">退出系统</a></div>
    </div>   
    <div data-options="region:'south',split:true" style="height: 40px;background: #5C160C">
    	<div style="text-align: center;font-size:15px; color: #FAF7F7;font-family: 楷体" >&copy;百知教育 htf@zparkhr.com.cn</div>
    </div>   
       
    <div data-options="region:'west',title:'导航菜单',split:true" style="width:220px;">
    	<div id="aa" class="easyui-accordion" data-options="fit:true">
    		
		</div>  
    </div>   
    <div data-options="region:'center'">
    	<div id="tt" class="easyui-tabs" data-options="fit:true,narrow:true,pill:true">   
		    <div title="主页" data-options="iconCls:'icon-neighbourhood',"  style="background: url(image/shouye2.jpg) no-repeat;background-size:100% 100%;"></div>
		</div>  
    </div>   
</body> 
</html>